package service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.InvitationDao;
import entity.Invitation;
import entity.Page;

@Service
public class InvitationServiceImpl  implements InvitationService{

	@Autowired
	InvitationDao invitationDao;

	@Override
	public Page<Invitation> selectPage(String title, Integer pageNo) {
		Page<Invitation> page = new Page<>(pageNo);
		page.setTotalCount(invitationDao.selectCount(title));
		page.setDataList(invitationDao.selectList(title, page.getStartRow(), page.getPageSize()));
		return page;
	}

	@Override
	public boolean delete(Integer id) {
		return invitationDao.delete(id) > 0;
	}
	
	
}
